fix(v2): emit Revealed events for fixed voters in auto-reveal path - #202
Merged
collinsezedike merged 1 commit intoSep 6, 2026
Merged
Conversation
Closes drydocs#156. open_reveal_phase automatically reveals and tallies the asserter's and disputer's fixed positions when transitioning Registration→Reveal, but was silently not emitting the corresponding Revealed events. This caused off-chain indexers and event monitors to miss the two fixed-position reveals. Add Revealed { id, voter, choice }.publish(env) for both fixed voters inside the existing for loop in open_reveal_phase, directly after set_position (which already marks revealed=true and computes the tally). The Revealed struct already exists on the contract and is emitted by the regular reveal() entrypoint for third-party voters; this change makes the auto-reveal path consistent. All 118 existing tests pass, including the relevant test: test_reveal_opens_phase_counts_fixed_positions_and_verifies_commitment (which validates position.revealed=true and agree/disagree_weight). Snapshot files regenerated accordingly.
ZacLou
force-pushed
the
fix/revealed-events-auto-reveal-156
branch
from
September 6, 2026 13:17
9373554 to
85055b7
Compare
collinsezedike
approved these changes
Sep 6, 2026
collinsezedike
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this, clean fix, matches the issue exactly. Merging now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #156.
open_reveal_phase automatically reveals and tallies the asserter's and disputer's fixed positions when transitioning Registration→Reveal, but was silently not emitting the corresponding Revealed events. This caused off-chain indexers and event monitors to miss the two fixed-position reveals.
What changed
Revealed { id, voter, choice }.publish(env)for both fixed voters inside the existing for loop inopen_reveal_phase, directly afterset_positionRevealedstruct already exists on the contract and is emitted by the regularreveal()entrypoint for third-party voters; this change makes the auto-reveal path consistent.Validation
test_reveal_opens_phase_counts_fixed_positions_and_verifies_commitmentcontinues to pass (validatesposition.revealed=trueand agree/disagree weight)lib.rs, 14 lines of doc intest.rs